import { createRouter, createWebHashHistory } from 'vue-router'


const Home = () => import("@/views/Home.vue")
const Cart = () => import("@/views/Cart.vue")
const Detail = () => import("@/views/Detail.vue")
const Login = () => import("@/views/Login.vue")
const User = () => import("@/views/User.vue")
const Register = () => import("@/views/Register.vue")




const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/detail',
        name: 'Detail',
        component: Detail
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/cart',
        name: 'Cart',
        component: Cart
    },
    {
        path: '/user',
        name: 'User',
        component: User
    },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router